@extends('store::layout')
@section('content')
    <div class="row">
        <div class="col-12">
            <div class=" mb-2 pull-left">
                @component('backend::component.form.button')
                    @slot('title') 修改收货信息 @endslot
                    @slot('elem') a @endslot
                    @slot('btn') btn @endslot
                    @slot('color') primary @endslot
                    @slot('icon') hcl-edit @endslot
                    @slot('class') modal-box @endslot
                    @slot('params') {"area":"600px,500px","title":"修改收货信息"} @endslot
                    @slot('href') {{route('Store_Order_updateDeliver',['order_id'=>$info->order_id])}} @endslot
                @endcomponent
                @if($info->status == 1)
                    @component('backend::component.form.button')
                        @slot('title') 确认发货 @endslot
                        @slot('elem') a @endslot
                        @slot('color') info @endslot
                        @slot('icon') hcl-edit @endslot
                        @slot('class') modal-box @endslot
                        @slot('params') {"area":"600px,350px","title":"确认发货"} @endslot
                        @slot('href') {{route('Store_Order_send',['order_id'=>$info->order_id])}} @endslot
                    @endcomponent
                @endif
                @if($info->status == 0)
                    @component('backend::component.form.button')
                        @slot('title') 修改费用 @endslot
                        @slot('elem') a @endslot
                        @slot('color') info @endslot
                        @slot('icon') hcl-edit @endslot
                        @slot('class') modal-box @endslot
                        @slot('params') {"area":"600px,500px","title":"修改费用"} @endslot
                        @slot('href') {{route('Store_Order_updatePay',['order_id'=>$info->order_id])}} @endslot
                    @endcomponent
                @endif
                @if($info->status > -1)
                    @component('backend::component.form.button')
                        @slot('title') 关闭订单 @endslot
                        @slot('icon') hcl-circle-del @endslot
                        @slot('color') danger @endslot
                        @slot('params') {"url":"{{route('Store_Order_closeOrder',['order_id'=>$info->order_id])}}","confirm":"true"} @endslot
                        @slot('class') btn-ajax @endslot
                    @endcomponent
                @endif
            </div>
        </div><!-- end col -->
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="card-box">
                <!-- Logo & title -->
                <div class="clearfix">
                    <div class="float-left">
                        <img src="{{$store_info['store_logo']}}" alt="" height="20">
                    </div>
                    <div class="float-right">
                        <h4 class="m-0 d-print-none">订单</h4>
                    </div>
                </div>
                <div class="row">
                    <div class="col-6">
                        <div class="mt-3 pull-left">
                            <p class="m-b-10"><strong>发货状态:</strong> <span><span class="badge badge-danger">{{$info->is_send?'已发货':'未发货'}}</span></span></p>
                            <p class="m-b-10"><strong>快递名称:</strong> <span>{{get_expresses($info->express_name)}}</span></p>
                            <p class="m-b-10"><strong>快递单号:</strong> <span>{{$info->express_num ?? '无'}} </span></p>
                        </div>

                    </div><!-- end col -->
                    <div class="col-4 offset-2">
                        <div class="mt-3 float-right">
                            <p class="m-b-10"><strong>订单状态:</strong> <span class="float-right"><span class="badge badge-danger">{{config('shop.order_status')[$info->status]}}</span></span></p>
                            <p class="m-b-10"><strong>下单时间:</strong> <span class="float-right">{{$info->created_at}}</span></p>
                            <p class="m-b-10"><strong>订单号:</strong> <span class="float-right">{{$info->order_sn}} </span></p>
                        </div>
                    </div><!-- end col -->
                </div>
                <!-- end row -->

                <div class="row mt-3">
                    <div class="col-6">
                        <h6>收货信息</h6>
                        <address class="line-h-24">
                            {{$info->consignee}}<br>
                            {{$info->post_address}}<br>
                            <br>
                            <abbr title="联系方式">P:</abbr>{{$info->phone}}
                        </address>
                    </div> <!-- end col -->

                    <div class="col-6">
                        <h6>发货信息</h6>
                        <address class="line-h-24">
                            {{$info->store->store_name}}<br>
                            {{$info->store->store_name}}<br>
                            <br>
                            <abbr title="Phone">P:</abbr> {{$info->store->store_name}}
                        </address>
                    </div> <!-- end col -->
                </div>
                <!-- end row -->

                <div class="row">
                    <div class="col-12">
                        <div class="table-responsive">
                            <table class="table mt-4 table-centered">
                                <thead>
                                <tr><th>图片</th>
                                    <th>商品名称</th>
                                    <th style="width: 20%">规格</th>
                                    <th style="width: 10%">价格</th>
                                    <th style="width: 10%">数量</th>
                                    <th style="width: 10%" class="text-right">小计</th>
                                </tr></thead>
                                <tbody>
                                @foreach($info->goods as $item)
                                <tr>
                                    <td><img src="{{$item->goods_img}}" style="height: 40px;"></td>
                                    <td>{{$item->goods_name}}</td>
                                    <td>{{$item->goods_spec ?? '无'}}</td>
                                    <td>{{$item->price}}</td>
                                    <td>{{$item->number}}</td>
                                    <td class="text-right">{{$item->pay_money}}</td>
                                </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div> <!-- end table-responsive -->
                    </div> <!-- end col -->
                </div>
                <!-- end row -->

                <div class="row">
                    <div class="col-6">
                        <div class="clearfix pt-5">
                            <h6 class="text-muted">注意:</h6>

                            <small class="text-muted">
                                所有账目应在7天内支付。如果在7天内未支付账户，作为所开展工作的确认书提供的信贷详细信息将收取上述商定的报价费用。
                            </small>
                        </div>
                    </div> <!-- end col -->
                    <div class="col-6">
                        <div class="float-right">
                            <p><b>商品总价:</b> <span class="float-right">{{$info->goods_price}}</span></p>
                            <p><b>消费积分:</b> <span class="float-right">{{$info->pay_xf_points??0}}</span></p>
                            <h3>{{$info->pay_price}}</h3>
                        </div>
                        <div class="clearfix"></div>
                    </div> <!-- end col -->
                </div>
                <!-- end row -->

                <div class="mt-4 mb-1">
                    <div class="text-right d-print-none">
                        <a href="javascript:window.print()" class="btn btn-primary waves-effect waves-light"><i class="mdi mdi-printer mr-1"></i> 打印</a>
                    </div>
                </div>
            </div>

        </div>

    </div>
@endsection